
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>TCP 是用来解决什么问题的？ - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>TCP 是用来解决什么问题的？ - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">TCP是如何确保数据传输的可靠性的？它主要运用了哪两种机制来解决数据丢失或损坏的问题？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">TCP通过确认应答（ACK）机制和校验和机制来确保数据传输的可靠性。确认应答（ACK）机制用于解决数据包丢失问题，发送方在未收到确认时会重发数据。校验和机制则用于检测数据包在传输过程中是否出现错误或损坏。</div>
          </div>
          <div class="card-source">来源: 文档中「1. 数据传输的可靠性」部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">当数据包在网络中经过不同路径导致到达顺序混乱时，TCP协议是如何保证数据能按正确顺序被处理的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">TCP通过为每个数据包分配序列号来保证顺序。接收方会根据这些序列号对收到的数据包进行重新排序，从而确保数据能够按照正确的顺序提交给应用层。</div>
          </div>
          <div class="card-source">来源: 文档中「2. 数据包的顺序」部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">什么是TCP的流量控制机制？它旨在解决什么问题？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">TCP的流量控制机制是指接收方告知发送方其缓冲区的大小，从而让发送方能根据接收方的处理能力来调整发送速率。该机制旨在解决因发送方发送速度过快、超出接收方处理能力而导致数据丢失的问题。</div>
          </div>
          <div class="card-source">来源: 文档中「3. 流量控制」部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">TCP的拥塞控制机制是什么？它通过哪些算法来避免网络性能下降？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">TCP的拥塞控制是一种动态调整数据发送速率的机制，用以减少网络拥塞并提高传输效率。它主要通过慢启动、拥塞避免、快速重传和快速恢复等算法来实现。</div>
          </div>
          <div class="card-source">来源: 文档中「4. 拥塞控制」部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">TCP如何保证数据的完整性，即数据在传输过程中不被损坏或篡改？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">TCP使用校验和机制来确保数据的完整性。每个数据包都会附带一个校验和，接收方利用这个校验和来检测数据在传输过程中是否发生了损坏。如果检测到损坏，接收方会请求重新传输该数据包。</div>
          </div>
          <div class="card-source">来源: 文档中「5. 数据完整性」部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">TCP支持哪种通信模式？这与半双工通信有何不同？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">TCP支持全双工通信。与只能在一个方向上发送或接收数据的半双工通信不同，全双工通信允许数据在两个方向上同时发送和接收，这使得实现双向实时通信成为可能。</div>
          </div>
          <div class="card-source">来源: 文档中「6. 全双工通信」部分</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
